(build) improvements in the CI solution #4252
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to improve code readability and maintainability by refactoring argument attributes, updating array syntax, and adding null checks. The most important changes include refactoring task argument attributes, updating array syntax for consistency, and adding null checks to prevent potential null reference exceptions.
Refactoring Task Argument Attributes:
build/artifacts/Tasks/ArtifactsDotnetToolTest.cs
: Replaced[TaskArgument]
attributes with more specific attributes like[DockerRegistryArgument]
,[DockerDotnetArgument]
, and[DockerDistroArgument]
.build/artifacts/Tasks/ArtifactsMsBuildCoreTest.cs
: Same refactoring as above.build/artifacts/Tasks/ArtifactsNativeTest.cs
: Same refactoring as above.build/artifacts/Tasks/ArtifactsPrepare.cs
: Same refactoring as above.build/artifacts/Tasks/ArtifactsTest.cs
: Same refactoring as above.Updating Array Syntax:
build/artifacts/Tasks/ArtifactsExecutableTest.cs
: Updated array initialization to use modern syntax.build/build/Tasks/Build.cs
: Updated array initialization to use modern syntax.build/build/Tasks/BuildPrepare.cs
: Same update as above.build/build/Tasks/Package/PackageChocolatey.cs
: Updated array and list initialization to use modern syntax. [1] [2]build/build/Tasks/Test/UnitTest.cs
: Same update as above.Adding Null Checks:
build/build/BuildLifetime.cs
: Added null check forcontext.Version
usingArgumentNullException.ThrowIfNull
.build/build/Tasks/ValidateVersion.cs
: Added null check forcontext.Version
usingArgumentNullException.ThrowIfNull
.build/common/Addins/GitVersion/GitVersionAliases.cs
: Replaced manual null checks withArgumentNullException.ThrowIfNull
. [1] [2]build/common/Addins/GitVersion/GitVersionRunner.cs
: Replaced manual null checks withArgumentNullException.ThrowIfNull
and refactored logging. [1] [2] [3] [4] [5] [6] [7]Miscellaneous Improvements:
build/common/Utilities/BuildContextBase.cs
: ChangedEnvironment
tocontext.Environment
for better clarity.build/common/Utilities/Constants.cs
: Added a comment to disable a specific ReSharper rule.